package net.neptech.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import net.neptech.mapper.StaffPositionMapper;
import net.neptech.model.sys.StaffPosition;
import net.neptech.service.StaffPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: liyuxiang
 * @Date: 2025/8/16 22:24
 * @Description: 员工岗位业务类
 */
@Service
public class StaffPositionServiceImpl implements StaffPositionService {
    @Autowired
    StaffPositionMapper staffPositionMapper;

    @Override
    public List<Long> selectPositionListByStaffId(Long staffId) {
        return staffPositionMapper.selectList(new LambdaQueryWrapper<>(StaffPosition.class).eq(StaffPosition::getStaffId, staffId)).stream().map(StaffPosition::getPositionId).collect(Collectors.toList());
    }
}
